<template>
  <section class="card">
    <div>
      <el-avatar :size="46" style="flex-shrink: 0;" :src="content?.groupInfo?.portrait" />
      <i>邀请你加入「{{ content?.groupInfo?.name }}」</i>
    </div>
    <div>
      <span>群组</span>
      <span>请到App端处理>></span>
    </div>
  </section>
</template>
<script>
import { defineComponent, computed } from 'vue';

export default defineComponent({
  props: {
    row: {
      type: Object,
      default: () => ({})
    }
  },
  setup (props, { emit }) {
    const content = computed(() => {
      try {
        return JSON.parse(props?.row?.content)
      } catch (error) {
        return props?.row?.content
      }
    })

    return {
      content,
    }
  }
})
</script>

<style scoped lang="less">
.card {
  width: 269px;
  height: 115px;
  background: #FFFFFF;
  opacity: 1;
  border: 1px solid rgba(177, 193, 194, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  cursor: pointer;

  >div {
    padding: 0 18px;

    &:first-child {
      display: flex;
      height: 84px;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;


      >i {
        margin-left: 10px;
        font-size: 16px;

        font-weight: 400;
        color: #242424;
        line-height: 22px;
      }
    }

    &:last-child {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12px;

      font-weight: 400;
      color: #787878;
      background: rgba(221, 223, 223, 0.2);
      flex: 1;
    }
  }
}
</style>
